﻿// JScript File


function OLMaps(strLocation)
{
    var lnt = 103.08187;    //x-axis coodinate in map units
    var lat = 38.05549;   //y-axis coordinate in map units
    var zoom = 5;   //number of zoom levels

    var map, layer;      //声明变量map、layer；等同于 var map = null; var layer = null;
    
    if (strLocation.length>0)
    {
        lat = strLocation.split(",")[0];
        lnt = strLocation.split(",")[1];
        //gmap.setCenter(new GLatLng(parseFloat(lat),parseFloat(lnt)), 9);
    }

    map = new OpenLayers.Map('map');

    //实例化一个地图类OpenLayers.Map

    gmap_Layers = new OpenLayers.Layer.WMS( "OpenLayers WMS","http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
    geoserver_Layers = new OpenLayers.Layer.WMS( "OpenLayers WMS","http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
    ims_Layers = new OpenLayers.Layer.WMS( "OpenLayers WMS","http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
    gml_Layers = new OpenLayers.Layer.WMS( "OpenLayers WMS","http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );

    //以WMS的格式实例化图层类OpenLayers.Layer
    map.addLayers([gmap_Layers, ims_Layers, gml_Layers]);
    map.addControl(new OpenLayers.Control.LayerSwitcher());
    map.zoomToMaxExtent();

    //map.zoomToExtent(newOpenLayers.Bounds(-3.922119,44.335327,4.866943,49.553833));



}